<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //if
    /*var count = 3;
    if (count == 3) {
        document.write(count);
    }*/

    //switch
    /*var num = 5;
    switch (num) {
        case 1: {
            document.write("星期一");
            break;
        }
        case 3: {
            document.write("星期三");
            break;
        }
        default: {
            document.write("error");
            break;
        }
    }*/

    //for
    /*var sum = 0;
    for (let i = 1; i <= 100; i++) {
        sum += i;
    }
    document.write(sum);*/

    //while
    /*var sum2 = 0;
    var i = 1;
    while (i <=100){
        sum2 +=i;
        i++
    }
    document.write(sum2);*/

    //do while
    var sum3 = 0;
    var j = 1;
    do {
        sum3+=j;
        j++;
    }while(j<=100)
    document.write(sum3);
</script>
</body>
</html>